/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package nxtmodel2.impl;

import nxtmodel2.Action;
import nxtmodel2.ActionAnnotation;
import nxtmodel2.Nxtmodel2Package;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Action Annotation</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link nxtmodel2.impl.ActionAnnotationImpl#getActionParent <em>Action Parent</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ActionAnnotationImpl extends NxtNodeImpl implements ActionAnnotation {
	/**
	 * The cached value of the '{@link #getActionParent() <em>Action Parent</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActionParent()
	 * @generated
	 * @ordered
	 */
	protected Action actionParent;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ActionAnnotationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return Nxtmodel2Package.Literals.ACTION_ANNOTATION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Action getActionParent() {
		if (actionParent != null && actionParent.eIsProxy()) {
			InternalEObject oldActionParent = (InternalEObject)actionParent;
			actionParent = (Action)eResolveProxy(oldActionParent);
			if (actionParent != oldActionParent) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, Nxtmodel2Package.ACTION_ANNOTATION__ACTION_PARENT, oldActionParent, actionParent));
			}
		}
		return actionParent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Action basicGetActionParent() {
		return actionParent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setActionParent(Action newActionParent) {
		Action oldActionParent = actionParent;
		actionParent = newActionParent;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Nxtmodel2Package.ACTION_ANNOTATION__ACTION_PARENT, oldActionParent, actionParent));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case Nxtmodel2Package.ACTION_ANNOTATION__ACTION_PARENT:
				if (resolve) return getActionParent();
				return basicGetActionParent();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case Nxtmodel2Package.ACTION_ANNOTATION__ACTION_PARENT:
				setActionParent((Action)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case Nxtmodel2Package.ACTION_ANNOTATION__ACTION_PARENT:
				setActionParent((Action)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case Nxtmodel2Package.ACTION_ANNOTATION__ACTION_PARENT:
				return actionParent != null;
		}
		return super.eIsSet(featureID);
	}

} //ActionAnnotationImpl
